package dev.ideas.funkyj.sequence;

import org.junit.Test;

import java.util.Arrays;

import static dev.ideas.funkyj.sequence.Sequence.*;
import static org.junit.Assert.assertEquals;

/**
 */
public class Sort {

    @Test public void sort() {
        assertEquals(
                from(6, 5, 4, 3, 2, 1).where(even).sort().asList(),
                Arrays.asList(2, 4, 6));

        assertEquals(
                from(range(1, 6)).where(even).sort(desc).asList(),
                Arrays.asList(6, 4, 2));
    }
}
